void main() {
  int age = 2;
  double weight = 4.5;
  //String output = '$weight + $age';
  double output = bmi(height: 1.65);
  print(output);

  Human human = Human("wonderful", 65, 1.8);
  print(human.toString());

  Student student = Student("wonderful", 65, 1.8, school: "哈哈哈");
  print(student.bmi());

  Set<int> a = {1, 9, 4};
  Set<int> b = {1, 9, 3};
  print(a.difference(b));
  print(b.difference(a));
  print(a.union(b));
  print(a.intersection(b));
}

/// 命名参数
double bmi({required double height, double weight = 65}) {
  double res = weight / (height * height);
  return res;
}

/// 位置参数
double bmi2([double height = 1.66, double weight = 65]) {
  double res = weight / (height * height);
  return res;
}

class Human {
  String name = '';
  double weight = 0;
  double height = 0;

  Human(this.name, this.weight, this.height);

  double bmi() {
    return weight / (height * height);
  }

  @override
  String toString() {
    return "human: name=$name, weight=$weight, height=$height";
  }
}

class Student extends Human {
  final String school;

  Student(super.name, super.weight, super.height, {required this.school});

  @override
  String toString() {
    return "${super.toString()}, school=$school";
  }
}
